<html xmlns="http://www.w3.org/1999/xhtml" xmlns:lift="http://liftweb.net/">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<title class="lift:Menu.title">COLLABORATIVE IDE</title>
	

    <link href="/css/style.css" rel="stylesheet" type="text/css" />
	
	<!-- <link rel="stylesheet" type="text/css" href="mode/clike/clike.css"/> -->
	<style type="text/css"> 
	.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
	.activeline {background: #fff !important;}
	</style>
	<style type="text/css">
		
	
		
		
/* <![CDATA[ */
.edit_error_class {
  display: block;
  color: red;
}

.userMenu{
	float:left;
	width:100%;
	list-style:none;
	font-weight:bold;
	
	margin-top:0px;
}
.userMenu li{
	float:left;
	margin-right:10px;
	/* position:relative; */
	display:block;
}
.userMenu li a{
	color:#666;
	background-color:transparent;
	font-size:14px;
	font-family:Tahoma;
	font-weight:normal;
	text-decoration:none;
	padding:5px 8px;
}
.userMenu li a:hover{
	color: #6399cd;
	background-color:#EFF4FA;
	text-decoration:none;
}
.userMenu ul li.active a
{
	color: #6399cd;
	background-color:#EFF4FA;
	text-decoration:none;
	font-weight:bolder;
}

#userMenuID{
	margin-top:0px;
	}

/* ]]> */
  </style>

	<!-- /CSS -->
	
	<!-- SCRIPTS -->
	<!--projectHTML(myId: Long)-->
	<script type="text/javascript" src="http://usiedit.appspot.com/static/lib/codemirror.js"></script>	
	<script type="text/javascript" src="http://usiedit.appspot.com/static/lib/modaldbox.js"></script>
	<script type="text/javascript" src="/classpath/jquery.js"></script>
	<SCRIPT SRC="http://usiedit.appspot.com/static/lib/diff_match_patch_uncompressed.js"></SCRIPT>
	<SCRIPT SRC="http://usiedit.appspot.com/static/lib/mobwrite_core.js"></SCRIPT>
	<script src="http://usiedit.appspot.com/static/lib/simple_differ.js"></script>
	<script src="http://usiedit.appspot.com/static/lib/mobwrite_codemirror.js"></script>
	
	<script id="json" src="/classpath/json.js" type="text/javascript"></script>
	
	<script src="http://usiedit.appspot.com/static/compressed_form.js"></script>
	<script>
	  mobwrite.syncGateway = 'http://usiedit.appspot.com/scripts/q.py';
	</script>
	
	<script type="text/javascript">
  		function saveBuffer() {
    	var buffer = jQuery('#buffer')[0];
    	buffer.value = demo_editor_text.getCode();
    	var form = jQuery('#save_form form')[0];
    	// this doesn't work!
    	// form.submit();
    	var onsubmit = form.getAttribute('onsubmit');
    	var fs = 'function xyzzy() { ' + onsubmit + ' };';
    	// alert('buffer ' + buffer.value);
    	eval(fs);
    	xyzzy();
  		}
	</script>
	
	<script type="text/javascript">
		var filename;
		function getURL() {
			var strHref = window.location.href;
			var url = strHref.split('/');
			window.filename = url.pop();
		}
	</script>
	
	<script type="text/javascript" charset="utf-8">
	window.onresize = height_size;
	
	function height_size() {
		var table_height = window.innerHeight - 34;
		var editor_height = window.innerHeight - 140;
		var log_height = table_height - editor_height - 5;
		var main_table = document.getElementById('main_table');
		var editor = document.getElementById(filename);
		var log = document.getElementById('log');
		main_table.style.height = table_height + 'px';
		editor.style.height = editor_height + 'px';
		log.style.height = log_height + 'px';
	}
	
		function editor_text() {
			// var demo_editor_text = mobwrite.shareCodeMirror.create(filename, {
			// 		    height: '100%',
			// 		    width: '100%',
			// 		    parserfile: ['tokenizejavascript.js', 'parsejavascript.js'],
			// 		    path: 'http://usiedit.appspot.com/static/lib/',
			// stylesheet: 'http://usiedit.appspot.com/static/lib/jscolors.css',
			// 		    tabMode: 'shift',
			// 		    autoMatchParens: true
			// 		  });
		}
	
		
	 </script>
	
	
	
	<script type="text/javascript">

	
	function sidebar(side) {
		
		
		if(side == 'left') {
			
			if(left.value == 'true') {
				
				left.style.display = 'none';
				
				if(right.value == 'true') {
					codearea.style.width = '90%';
				} else {
					codearea.style.width = '100%';
				}
				
				left.value = 'false';
				left_button.value = 'Show Project Browser';
				
			} else {
				
				left.style.display = 'inline';
				
				if(right.value == 'true') {
					codearea.style.width = '80%';
				} else {
					codearea.style.width = '90%';
				}
				
				left.value = 'true';
				left_button.value = 'Hide Project Browser';
				
			}
		} else {
			
			if(right.value == 'true') {
				
				right.style.display = 'none';
				
				if(left.value == 'true') {
					codearea.style.width = '90%';
				} else {
					codearea.style.width = '100%';
				}
				
				right.value = 'false';
				right_button.value = 'Show Chat';
				
			} else {
				
				right.style.display = 'inline';
				
				if(left.value == 'true') {
					codearea.style.width = '80%';
				} else {
					codearea.style.width = '90%';
				}
				
				right.value = 'true';
				right_button.value = 'Hide Chat';	
			}
		}
	}

	</script>
		
  </head>

<!-- INSERIRE IL NOME DEL FILE -->
<!-- <body onload="var name = getURL(); "> -->
	<body onload="assign_value(); getURL(); height_size(); mobwrite.share(filename); editor_text();" >
		<div align="center" style="width:500px; margin: 0 auto;">
			
			<div style="width:500px; margin-top:2px;">
				<img src="/img/logo.png" alt="the project logo" title="the LOGO"/>
			</div>
		
		<div class="logInBox">
		<div class="logInHome">
        	<div id="content" >The main content will get bound here</div>
		</div>
		<div align="center" style="width:500px; margin:5px auto;">	
					<span  class="userMenu" align="center"><lift:Menu.builder></lift:Menu.builder></span>
		</div>
		</div>
	
       </div>
		<script type="text/javascript" charset="utf-8">
			var codearea = document.getElementById('codearea');
			var left = document.getElementById('left_sidebar');
			var right = document.getElementById('right_sidebar');
			var left_button = document.getElementById('left_button');
			var right_button = document.getElementById('right_button');
			left.value = 'true';
			right.value = 'true';
		</script>
		
  </body>
</html>
